﻿using RimWorld;
using RimWorld.Planet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SZ.Mech
{
    public class IncidentWorker_DanFurnaceRoom : IncidentWorker
    {
        private static readonly int minDist = 3;
        private static readonly int maxDist = 5;

        protected override bool CanFireNowSub(IncidentParms parms)
        {
            return true;
        }

        /// <summary>
        /// 使用Point点数的情况下就可以调用了
        /// </summary>
        /// <param name="parms"></param>
        /// <returns></returns>
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            int tile;
            if (!TileFinder.TryFindNewSiteTile(out tile, minDist, maxDist, false, tileFinderMode: TileFinderMode.Random, exitOnFirstTileFound: false))
            {
                return false;
            }

            //Site site = SiteMaker.MakeSite(SitePartDefOf.BanditCamp, tile, Faction.OfAncientsHostile);
            Site site = SiteMaker.MakeSite(SZ_DefOf.DanFurnaceRoom, tile, Faction.OfAncientsHostile,true,400);
            var t = site.HasMap;

            return true;

        }
    }
}
    